home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / c / stdlib / RCS / strtod.man,v < prev    next >
Encoding:
Text File  |  1989-01-06  |  2.2 KB  |  80 lines

  1. head     1.1;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @@;
  7.  
  8.  
  9. 1.1
  10. date     89.01.05.18.00.47;  author ouster;  state Exp;
  11. branches ;
  12. next     ;
  13.  
  14.  
  15. desc
  16. @@
  17.  
  18.  
  19.  
  20. 1.1
  21. log
  22. @Initial revision
  23. @
  24. text
  25. @' Copyright 1989 Regents of the University of California
  26. ' Permission to use, copy, modify, and distribute this
  27. ' documentation for any purpose and without fee is hereby
  28. ' granted, provided that this notice appears in all copies.
  29. ' The University of California makes no representations about
  30. ' the suitability of this material for any purpose.  It is
  31. ' provided "as is" without express or implied warranty.
  32. ' $Header: /sprite/lib/forms/RCS/proto.man,v 1.1 88/12/29 17:09:50 ouster Exp $ SPRITE (Berkeley)
  33. .so \*(]ltmac.sprite
  34. .HS strtod cmds
  35. .BS
  36. .SH NAME
  37. strtod \- Convert character string to floating-point number
  38. .SH SYNOPSIS
  39. .nf
  40. \fB#include <stdlib.h>
  41.  
  42. \fBdouble
  43. \fBstrtod(\fIstring\fR, \fIendPtr\fR)
  44. .SH ARGUMENTS
  45. .AS "char *" endPtr
  46. .AP char *string in
  47. String containing ASCII representation of floating-point number.
  48. .AP char **endPtr out
  49. If not \fBNULL\fR, gives address of pointer to fill in with address of
  50. first character not forming part of number.
  51. .BE
  52.  
  53. .SH DESCRIPTION
  54. .PP
  55. The \fBstrtod\fR procedure parses a floating-point number in ASCII
  56. representation and returns a \fBdouble\fR result containing the
  57. binary form of the number.  The expected
  58. form of \fIstring\fR is an optional plus or minus sign, then a sequence
  59. of decimal digits optionally containing a decimal point, then an
  60. optional exponent part.  If the exponent part is present, it consists
  61. of the letter \fBE\fR (or \fBe\fR), then an optional plus or minus sign,
  62. then a sequence of decimal digits.  The entire floating-point number
  63. may be preceded by any amount of white space (as defined by the
  64. \fBisspace\fR procedure).
  65. .PP
  66. \fIStrtod\fR examines as many characters as possible from \fIstring\fR
  67. while still obeying the syntax rules given above.
  68. If \fIendPtr\fR is not \fBNULL\fR, then the address of the first
  69. character following the floating-point number is stored in \fI*endPtr\fR.
  70. .PP
  71. If \fIstring\fR does not refer to a floating-point number in the format
  72. given above, then zero is returned and \fIstring\fR will be stored at
  73. \fI*endPtr\fR.
  74.  
  75. .SH KEYWORDS
  76. convert, floating-point, string
  77. @
  78.